import React, { Component } from 'react'
import {connect} from 'react-redux'

import Head from './Head'
import './manager.css'
class Managers extends Component {
    constructor(props){
        super();
        console.log(props.managers)
        this.state={
            inpno:props.managers.Mno,
            inpname:props.managers.Mname,
            inppsd:props.managers.Pwd,
        }  
    }   
    render() {
        // console.log(this.props.managers)
        return (
            <div>
                <Head />
                <div className='info'>
                    <div className='item'>
                        <span>账号：</span>
                        <input 
                            style={{marginLeft:'53px'}}
                            type="text" 
                            value={this.state.inpno}
                            disabled
                        />
                    </div>
                    <div className='item'>
                        <span>姓名：</span>
                        <input 
                            style={{marginLeft:'53px'}}
                            type="text" 
                            value={this.state.inpname}
                            disabled
                        />
                    </div>
                    <div className='item'>
                        <span>密码：</span>
                        <input 
                            style={{marginLeft:'53px'}}
                            type="password" 
                            value={this.state.inpno}
                            disabled
                        />
                    </div>
                    <div className='item'>
                        <span>用户类别：</span>
                        <input 
                            style={{marginLeft:'24px'}}
                            type="text" 
                            value="管理员"
                            disabled
                        />
                    </div>
                    <button className='btn' onClick={()=>this.props.history.push('/modifyman')}>
                        修改信息
                    </button>
                </div>
            </div>
        )
    }
}
const mapStateToProps=(state)=>({
    managers:JSON.parse(state.login.managers),
    // managers:(state.login.managers),

}); 

export default  connect(mapStateToProps)(Managers);
